load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("scm_client_infra")

cpp_library(
    name = "stats",
    srcs = [
        "EdenStats.cpp",
    ],
    headers = [
        "EdenStats.h",
    ],
    exported_deps = [
        "//eden/common/telemetry:structured_logger_factory",
        "//eden/common/telemetry:telemetry",
        "//eden/common/utils:ref_ptr",
        "//eden/fs:config",
        "//folly:thread_local",
    ],
)

cpp_library(
    name = "task_trace",
    srcs = [
        "TaskTrace.cpp",
    ],
    headers = [
        "TaskTrace.h",
    ],
    deps = [
        "//folly/system:thread_id",
        "//folly/system:thread_name",
    ],
    exported_deps = [
        "//eden/common/telemetry:telemetry",
    ],
)

cpp_library(
    name = "file_access_structured_logger",
    srcs = [
        "FileAccessStructuredLogger.cpp",
    ],
    headers = [
        "FileAccessStructuredLogger.h",
    ],
    exported_deps = [
        ":structured_logger",
        "//eden/common/telemetry:log_info",
        "//eden/common/telemetry:scribe_logger",
    ],
)

cpp_library(
    name = "scribe_logger",
    headers = [
        "IScribeLogger.h",
    ],
    exported_deps = [
        "//eden/common/telemetry:log_info",
        "//eden/fs/config:config",
    ],
)

cpp_library(
    name = "activity_recorder",
    headers = [
        "IActivityRecorder.h",
    ],
    exported_deps = [
        "//eden/common/utils:path",
    ],
)

cpp_library(
    name = "fs_event_logger",
    srcs = [
        "FsEventLogger.cpp",
    ],
    headers = [
        "FsEventLogger.h",
    ],
    deps = [
        ":scribe_logger",
        "//eden/fs/config:config",
        "//folly:random",
    ],
    exported_deps = [
        "//folly:range",
        "//folly:synchronized",
    ],
)

cpp_library(
    name = "log_info",
    headers = [
        "LogEvent.h",
    ],
    exported_deps = [
        "//eden/common/os:os",
        "//eden/common/telemetry:log_info",
        "//folly/portability:sys_types",
    ],
)

cpp_library(
    name = "activity_buffer",
    headers = [
        "ActivityBuffer.h",
    ],
    exported_deps = [
        "//eden/fs/utils:ring_buffer",
        "//folly:synchronized",
    ],
)

cpp_library(
    name = "structured_logger",
    srcs = [
        "EdenStructuredLogger.cpp",
    ],
    headers = [
        "EdenStructuredLogger.h",
    ],
    exported_deps = [
        "//eden/common/telemetry:log_info",
        "//eden/common/telemetry:scribe_logger",
        "//eden/common/telemetry:structured_logger",
    ],
)
